
package com.fly.spring.data.jdbc.domain;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;

import org.hibernate.validator.constraints.Range;
import org.springframework.data.annotation.Id;
import org.springframework.data.relational.core.mapping.Column;
import org.springframework.data.relational.core.mapping.Table;

@Table("user")
public class User
{
    @Id
    @Column("id")
    private Long id;
    
    /**
     * 
     */
    @NotBlank(message = "用户名不能为空")
    @Column("name")
    private String name;
    
    /**
     * 
     */
    @NotNull(message = "年龄不能为空")
    @Range(min = 10, max = 50, message = "年龄必须在{min}-{max}")
    @Column("age")
    private Integer age;
    
    /**
     * @return the id
     */
    public Long getId()
    {
        return id;
    }
    
    /**
     * @param id the id to set
     */
    public void setId(Long id)
    {
        this.id = id;
    }
    
    /**
     * @param name the name to set
     */
    public void setName(String name)
    {
        this.name = name;
    }
    
    /**
     * @return the name
     */
    public String getName()
    {
        return this.name;
    }
    
    /**
     * @param age the age to set
     */
    public void setAge(Integer age)
    {
        this.age = age;
    }
    
    /**
     * @return the age
     */
    public Integer getAge()
    {
        return this.age;
    }
}
